bsd: round out BPF bindings on apple and freebsd#5235
Conversation
|
Could someone please re-run the |
|
The PR template asks for links to source headers. Could you please include them? |
646c595 to
cf248c1
Compare
|
@tgross35 I've addressed your comment and also moved everything under |
8772c73 to
404e3a1
Compare
This comment has been minimized.
This comment has been minimized.
|
I've addressed the earlier feedback by moving the definitions into P.S. I'm new here, so I'm not sure how long it usually takes for a PR to get merged. My first one was merged pretty quickly :) |
404e3a1 to
1f0cfad
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Two small things that I know were preexisting, but we may as well clean up here. After that, LGTM.
P.S. I'm new here, so I'm not sure how long it usually takes for a PR to get merged. My first one was merged pretty quickly :)
Unfortunately it's pretty variable, anywhere from 1-6ish weeks depending on availability. This repo occasionally gets bursts of higher-priority work that kind of zap our time reviewing.
| // sizeof(i32) | ||
| pub const BPF_ALIGNMENT: c_int = 4; |
There was a problem hiding this comment.
Just use size_of::<i32>() as c_int to match the source
| pub const BIOCGRSIG: c_ulong = 0x40044272; | ||
| pub const BIOCSRSIG: c_ulong = 0x80044273; | ||
| pub const BIOCSDLT: c_ulong = 0x80044278; | ||
| pub const BIOCGSEESENT: c_ulong = 0x40044276; | ||
| pub const BIOCSSEESENT: c_ulong = 0x80044277; | ||
| pub const BIOCGDLTLIST: c_ulong = 0xc00c4279; |
There was a problem hiding this comment.
I'm adding the _IO* functions in #5264, please use those once that merges
|
Reminder, once the PR becomes ready for a review, use |
1f0cfad to
8e352cc
Compare
This comment has been minimized.
This comment has been minimized.
8e352cc to
2324268
Compare
|
Clippy fix coming via #5266, rebase after that lands |
I was about to push the fix myself :) |
apple was missing the two bpf structs; freebsd was missing the DLT_* link types.
2324268 to
abc870f
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Description
Make the BPF bindings match across Apple and FreeBSD: add
bpf_programandbpf_insnon Apple (FreeBSD already has them), and theDLT_*link-layer types on FreeBSD/DragonFly (Apple already has them).Sources
Apple
bpf_program/bpf_insn/DLT_*(net/bpf.h):FreeBSD
DLT_*(net/dlt.h):Checklist
libc-test/semverhave been updated*LASTor*MAXare includedcd libc-test && cargo test --target mytarget)